<template>
  <div id="return">
    <div class="content">
      <div class="return">
        <span>退货原因</span>
        <div class="input">
          <input type="text" placeholder="请输入退货原因" v-model="returnReason">
        </div>
      </div>
      <div class="return phone">
        <span>手机号</span>
        <div class="input">
          <input type="text" placeholder="填写手机号，方便我们联系您" v-model="phone">
        </div>
      </div>
      <div class="return up">
        <span>商品图</span>
        <div class="input" @click="displayMotai">
          <p>上传需要退货的商品图</p>
          <!-- <label><input type="file">上传需要退货的商品图</label> -->
        </div>
        <div class="photo">
          <img src="../../assets/photo1.png" alt="">
          <img src="../../assets/photo1.png" alt="">
        </div>
      </div>
    </div>
    <div class="bottom" @click="isSubmit">
      <div class="hand">
        <img src="../../assets/tijiao.png" alt="">
        <span>提交</span>
      </div>
    </div>
    <div class="message" v-if="isShow">
      亲爱的，您还没有填写完成哦~
    </div>
    <!-- 模态框 -->
    <div class="motai" v-if="isMotai" @click="hideMotai">
      <div
      :class="{model: true,animation: isModel}">
        <div class="title public">请上传射频卡带卡号的一面</div>
        <div class="album public" @click="goAlbum">相册</div>
        <div class="camera public">照相机</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Return',
  data () {
    return {
      returnReason: '',
      phone: '',
      isShow: false,
      isMotai: false,
      isModel: false
    }
  },
  created () {
    document.title = '申请退货'
  },
  methods: {
    isSubmit () {
      console.log(this.returnReason)
      if (this.returnReason !== '' && this.phone !== '') {
        alert('成功')
      } else {
        this.isShow = !this.isShow
      }
    },
    displayMotai () {
      this.isMotai = true
      if (this.isMotai) {
        this.isModel = true
      }
    },
    hideMotai () {
      this.isMotai = false
    },
    goAlbum () {
      console.log('take photo')
    }
  }
}
</script>

<style lang='scss' scoped>
#return{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  .content{
    flex: 1;
    padding: 5.33vw 3.46vw;
    background-color: #fff;
    .return{
      span{
        font-size: 3.73vw;
        font-family: SourceHanSansCN-Regular;
        font-weight: 400;
        color: rgba(168,168,168,1);
      }
      .input{
        height: 12.53vw;
        margin-top: 6.66vw;
        padding: 0 3.46vw;
        border-bottom: 1px solid #d8d8d8;
        input{
          width: 100%;
          height: 93%;
          border: none;
          outline: none;
          font-family: SourceHanSansCN-Regular;
          font-weight: 400;
          color: rgba(192,192,192,1);
          font-size: 4.53vw;
        }
      }
    }
    .phone{
      margin-top: 8vw;
    }
    .up{
      margin-top: 8vw;
      .input{
        height: 8.63vw;
        p{
          font-size: 4.53vw;
          font-family: SourceHanSansCN-Regular;
          font-weight: 400;
          color: rgba(192,192,192,1);
        }
        label{
          font-size: 4.53vw;
          font-family: SourceHanSansCN-Regular;
          font-weight: 400;
          color: rgba(192,192,192,1);
          input{
            width: 0;
            height: 0;
            opacity: 0;
          }
        }
      }
      .photo{
        margin-top: 1vw;
        img{
          width: 30.13vw;
          height: 30.13vw;
        }
      }
    }
  }
  .bottom{
    width: 100%;
    height: 14.66vw;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    bottom: 0;
    .hand{
      color: #0A6DFF;
      img{
        width: 4.53vw;
        height: 4.53vw;
        margin-right: 2vw;
      }
      span{
        font-size: 4.53vw;
        font-family: SourceHanSansCN-Normal;
        font-weight: 400;
      }
    }
  }
  .message{
    width: 84vw;
    height: 10.4vw;
    background-color: #000;
    color: white;
    text-align: center;
    line-height: 10.4vw;
    font-size: 4.26vw;
    font-family: SourceHanSansCN-Regular;
    font-weight: 400;
    position: absolute;
    top: 76vw;
    left: 8vw;
  }
  .motai{
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    position: absolute;
    z-index: 250;
    .model{
      width: 100%;
      height: 0;
      // height: 44vw;
      background-color: #fff;
      position: fixed;
      bottom: 0;
      border-radius: 2.13vw 2.13vw 0px 0px;
      &.animation{
        height: 44vw;
        transition: height 3s;
      }
      .public{
        height: 14.66vw;
        line-height: 14.66vw;
        padding: 0 3.46vw;
        &.title{
          font-size: 3.73vw;
          font-family: SourceHanSansCN-Regular;
          font-weight: 400;
          color: rgba(134,134,134,1);
      }
      }
    }
  }
}
</style>
